<?php

/**
 * VstAlumnoAnuncio filter form base class.
 *
 * @package    reducars
 * @subpackage filter
 * @author     victor
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseVstAlumnoAnuncioFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_anuncio' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'nombre'     => new sfWidgetFormFilterInput(),
      'rut'        => new sfWidgetFormFilterInput(),
      'fecha_hora' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'rango_hora' => new sfWidgetFormFilterInput(),
      'leido'      => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'id_anuncio' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'nombre'     => new sfValidatorPass(array('required' => false)),
      'rut'        => new sfValidatorPass(array('required' => false)),
      'fecha_hora' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'rango_hora' => new sfValidatorPass(array('required' => false)),
      'leido'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('vst_alumno_anuncio_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'VstAlumnoAnuncio';
  }

  public function getFields()
  {
    return array(
      'id'         => 'Number',
      'id_anuncio' => 'Number',
      'nombre'     => 'Text',
      'rut'        => 'Text',
      'fecha_hora' => 'Date',
      'rango_hora' => 'Text',
      'leido'      => 'Number',
    );
  }
}
